using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using GreyMagic;
using log4net;
using ns25;
using ns27;
using Triton.Common;
using Triton.Common.LogUtilities;
using Triton.Game.Data;
using Triton.Game.Mapping;
using Triton.Game.Mono;

namespace Triton.Game
{
	public static class TritonHs
	{
		internal delegate byte[] Delegate6(string v, out string message);

		private enum Enum19
		{
			Play,
			Quest,
			Store,
			Collection,
			Packs,
			Adventure,
			Arena,
			TavernBrawl
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class Class246
		{
			public static readonly Class246 Instance9;

			public static EventHandler Instance9__36_0;

			public static Func<List<AchievementData>> Instance9__70_0;

			public static Func<Card, HSCard> Instance9__75_0;

			public static Func<Card, HSCard> Instance9__75_1;

			public static Func<Card, HSCard> Instance9__75_2;

			public static Func<List<HSCard>> Instance9__77_0;

			public static Func<GameState> Instance9__84_0;

			public static Func<int> Instance9__87_0;

			public static Func<int> Instance9__90_0;

			public static Func<int> Instance9__93_0;

			public static Func<int> Instance9__96_0;

			public static Func<int> Instance9__99_0;

			public static Func<int> Instance9__102_0;

			public static Func<int> Instance9__105_0;

			public static Func<int> Instance9__108_0;

			public static Func<int> Instance9__111_0;

			public static Func<int> Instance9__114_0;

			public static Func<int> Instance9__117_0;

			public static Func<int> Instance9__120_0;

			public static Func<HSCard> Instance9__123_0;

			public static Func<HSCard> Instance9__126_0;

			public static Func<HSCard> Instance9__129_0;

			public static Func<HSCard> Instance9__132_0;

			public static Func<bool> Instance9__135_0;

			public static Func<bool> Instance9__138_0;

			public static Func<HSCard> Instance9__141_0;

			public static Func<HSCard> Instance9__144_0;

			public static Func<int> Instance9__147_0;

			public static Func<int> Instance9__150_0;

			public static Func<HSCard> Instance9__153_0;

			public static Func<HSCard> Instance9__156_0;

			public static Func<int> Instance9__159_0;

			public static Func<int> Instance9__162_0;

			static Class246()
			{
				Instance9 = new Class246();
			}

			internal void method_0(object sender, EventArgs e)
			{
				ilog_0.Info("[ProcessExited] The game process has closed. Hearthbuddy will now close.");
				Environment.Exit(0);
			}

			internal List<AchievementData> method_1()
			{
				List<AchievementData> list = new List<AchievementData>();
				AchieveManager achieveManager = AchieveManager.Get();
				if (achieveManager == null)
				{
					return list;
				}
				List<Achievement> activeQuests = achieveManager.GetActiveQuests(onlyNewlyActive: false);
				if (activeQuests == null)
				{
					return list;
				}
				foreach (Achievement item in activeQuests)
				{
					list.Add(new AchievementData(item));
				}
				return list;
			}

			internal HSCard method_2(Card card_0)
			{
				return new HSCard(card_0);
			}

			internal HSCard method_3(Card card_0)
			{
				return new HSCard(card_0);
			}

			internal HSCard method_4(Card card_0)
			{
				return new HSCard(card_0);
			}

			internal List<HSCard> method_5()
			{
				List<HSCard> list = new List<HSCard>();
				Entity entity = null;
				int num = 4;
				do
				{
					entity = GameState.GetEntity(num);
					num++;
					if (entity != null)
					{
						list.Add(new HSCard(entity));
					}
				}
				while (entity != null);
				return list;
			}

			internal GameState method_6()
			{
				return GameState.Get();
			}

			internal int method_7()
			{
				return GameState.GetFriendlySidePlayer().GetNumAvailableResources();
			}

			internal int method_8()
			{
				return GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.NUM_CARDS_PLAYED_THIS_TURN);
			}

			internal int method_9()
			{
				return GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.NUM_MINIONS_PLAYED_THIS_TURN);
			}

			internal int method_10()
			{
				return GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.RESOURCES);
			}

			internal int method_11()
			{
				return GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.OVERLOAD_LOCKED);
			}

			internal int method_12()
			{
				return GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.OVERLOAD_OWED);
			}

			internal int method_13()
			{
				return GameState.GetFriendlySidePlayer().GetHero().GetRealTimeRemainingHP();
			}

			internal int method_14()
			{
				return GameState.GetFriendlySidePlayer().GetHero().GetArmor();
			}

			internal int method_15()
			{
				return GameState.GetOpposingSidePlayer().GetHero().GetRealTimeRemainingHP();
			}

			internal int method_16()
			{
				return GameState.GetOpposingSidePlayer().GetHero().GetArmor();
			}

			internal int method_17()
			{
				return GameState.GetFriendlySidePlayer().GetHeroCard().GetRealTimeAttack();
			}

			internal int method_18()
			{
				return GameState.GetOpposingSidePlayer().GetHeroCard().GetRealTimeAttack();
			}

			internal HSCard method_19()
			{
				return new HSCard(GameState.GetFriendlySidePlayer().GetHeroPowerCard());
			}

			internal HSCard method_20()
			{
				return new HSCard(GameState.GetOpposingSidePlayer().GetHeroPowerCard());
			}

			internal HSCard method_21()
			{
				return new HSCard(GameState.GetFriendlySidePlayer().GetHeroCard());
			}

			internal HSCard method_22()
			{
				return new HSCard(GameState.GetOpposingSidePlayer().GetHeroCard());
			}

			internal bool method_23()
			{
				return GameState.GetFriendlySidePlayer().GetHero().GetWeaponCard() != null;
			}

			internal bool method_24()
			{
				return GameState.GetOpposingSidePlayer().GetHero().GetWeaponCard() != null;
			}

			internal HSCard method_25()
			{
				return new HSCard(GameState.GetFriendlySidePlayer().GetHero().GetWeaponCard());
			}

			internal HSCard method_26()
			{
				return new HSCard(GameState.GetOpposingSidePlayer().GetHero().GetWeaponCard());
			}

			internal int method_27()
			{
				return GameState.GetOpposingSidePlayer().GetFatigue();
			}

			internal int method_28()
			{
				return GameState.GetFriendlySidePlayer().GetFatigue();
			}

			internal HSCard method_29()
			{
				return new HSCard(GameState.GetCurrentPlayer());
			}

			internal HSCard method_30()
			{
				return new HSCard(GameState.GetOpposingSidePlayer());
			}

			internal int method_31()
			{
				RankMgr rankMgr = RankMgr.Get();
				if (rankMgr != null)
				{
					BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();
					if (myPlayer != null)
					{
						MedalInfoTranslator rankPresenceField = rankMgr.GetRankPresenceField(myPlayer);
						if (rankPresenceField != null)
						{
							TranslatedMedalInfo currMedalInfo = rankPresenceField.m_currMedalInfo;
							if (currMedalInfo != null)
							{
								return currMedalInfo.rank;
							}
						}
					}
				}
				return -1;
			}

			internal int method_32()
			{
				RankMgr rankMgr = RankMgr.Get();
				if (rankMgr != null)
				{
					BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();
					if (myPlayer != null)
					{
						MedalInfoTranslator rankPresenceField = rankMgr.GetRankPresenceField(myPlayer);
						if (rankPresenceField != null)
						{
							TranslatedMedalInfo currWildMedalInfo = rankPresenceField.m_currWildMedalInfo;
							if (currWildMedalInfo != null)
							{
								return currWildMedalInfo.rank;
							}
						}
					}
				}
				return -1;
			}
		}

		private static readonly ILog ilog_0;

		private static ExternalProcessMemory externalProcessMemory_0;

		internal static Class276 class276_0;

		internal static bool bool_0;

		private static IntPtr intptr_0;

		internal static Class247 class247_0;

		[CompilerGenerated]
		private static bool bool_1;

		[CompilerGenerated]
		private static readonly Stopwatch stopwatch_0;

		private static IntPtr intptr_1;

		[CompilerGenerated]
		private static bool bool_2;

		[CompilerGenerated]
		private static EventHandler<GuiTickEventArgs> eventHandler_0;

		public static List<string> BasicMageDeck;

		public static List<string> BasicDruidDeck;

		public static List<string> BasicHunterDeck;

		public static List<string> BasicPaladinDeck;

		public static List<string> BasicPriestDeck;

		public static List<string> BasicRogueDeck;

		public static List<string> BasicShamanDeck;

		public static List<string> BasicWarlockDeck;

		public static List<string> BasicWarriorDeck;

		private static PerFrameCachedValue<List<AchievementData>> perFrameCachedValue_0;

		private static PerFrameCachedValue<List<HSCard>> perFrameCachedValue_1;

		private static PerFrameCachedValue<GameState> perFrameCachedValue_2;

		private static PerFrameCachedValue<int> perFrameCachedValue_3;

		private static PerFrameCachedValue<int> perFrameCachedValue_4;

		private static PerFrameCachedValue<int> perFrameCachedValue_5;

		private static PerFrameCachedValue<int> perFrameCachedValue_6;

		private static PerFrameCachedValue<int> perFrameCachedValue_7;

		private static PerFrameCachedValue<int> perFrameCachedValue_8;

		private static PerFrameCachedValue<int> perFrameCachedValue_9;

		private static PerFrameCachedValue<int> perFrameCachedValue_10;

		private static PerFrameCachedValue<int> perFrameCachedValue_11;

		private static PerFrameCachedValue<int> perFrameCachedValue_12;

		private static PerFrameCachedValue<int> perFrameCachedValue_13;

		private static PerFrameCachedValue<int> perFrameCachedValue_14;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_15;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_16;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_17;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_18;

		private static PerFrameCachedValue<bool> perFrameCachedValue_19;

		private static PerFrameCachedValue<bool> perFrameCachedValue_20;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_21;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_22;

		private static PerFrameCachedValue<int> perFrameCachedValue_23;

		private static PerFrameCachedValue<int> perFrameCachedValue_24;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_25;

		private static PerFrameCachedValue<HSCard> perFrameCachedValue_26;

		private static PerFrameCachedValue<int> perFrameCachedValue_27;

		private static PerFrameCachedValue<int> perFrameCachedValue_28;

		public static TAG_CLASS[] BasicHeroTagClasses;

		public static bool IsBotFullyLoaded
		{
			[CompilerGenerated]
			get
			{
				return bool_1;
			}
			[CompilerGenerated]
			internal set
			{
				bool_1 = value;
			}
		}

		public static Stopwatch Runtime
		{
			[CompilerGenerated]
			get
			{
				return stopwatch_0;
			}
		}

		public static IntPtr ClientWindowHandle
		{
			get
			{
				if (intptr_0 == IntPtr.Zero)
				{
					intptr_0 = Interop.smethod_0(Memory.Process, "UnityWndClass");
				}
				return intptr_0;
			}
		}

		internal static Class276 Class276_0 => class276_0;

		public static ExternalProcessMemory Memory => externalProcessMemory_0;

		public static string MainAssemblyPath => Path.Combine(MainAssemblyDir, "Assembly-CSharp.dll");

		public static string MainAssemblyFirstPassPath => Path.Combine(MainAssemblyDir, "Assembly-CSharp-firstpass.dll");

		public static string UnityEngineAssemblyPath => Path.Combine(MainAssemblyDir, "UnityEngine.CoreModule.dll");

		public static string MainAssemblyDir => Path.Combine(Path.GetDirectoryName(Memory.Process.MainModule.FileName), "Hearthstone_Data", "Managed");

		public static bool Initialized
		{
			[CompilerGenerated]
			get
			{
				return bool_2;
			}
			[CompilerGenerated]
			private set
			{
				bool_2 = value;
			}
		}

		internal static string String_0 => Class247.String_0;

		public static List<AchievementData> CurrentQuests
		{
			get
			{
				if (perFrameCachedValue_0 == null)
				{
					perFrameCachedValue_0 = new PerFrameCachedValue<List<AchievementData>>(delegate
					{
						List<AchievementData> list = new List<AchievementData>();
						AchieveManager achieveManager = AchieveManager.Get();
						if (achieveManager == null)
						{
							return list;
						}
						List<Achievement> activeQuests = achieveManager.GetActiveQuests(onlyNewlyActive: false);
						if (activeQuests == null)
						{
							return list;
						}
						foreach (Achievement item in activeQuests)
						{
							list.Add(new AchievementData(item));
						}
						return list;
					});
				}
				return perFrameCachedValue_0;
			}
		}

		public static GameState GameState => perFrameCachedValue_2 ?? (perFrameCachedValue_2 = new PerFrameCachedValue<GameState>(() => GameState.Get()));

		public static int CurrentMana => perFrameCachedValue_3 ?? (perFrameCachedValue_3 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetNumAvailableResources()));

		public static int NumCardsPlayedThisTurn => perFrameCachedValue_4 ?? (perFrameCachedValue_4 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.NUM_CARDS_PLAYED_THIS_TURN)));

		public static int NumMinionsPlayedThisTurn => perFrameCachedValue_5 ?? (perFrameCachedValue_5 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.NUM_MINIONS_PLAYED_THIS_TURN)));

		public static int Resources => perFrameCachedValue_6 ?? (perFrameCachedValue_6 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.RESOURCES)));

		public static int OverloadLocked => perFrameCachedValue_7 ?? (perFrameCachedValue_7 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.OVERLOAD_LOCKED)));

		public static int OverloadOwed => perFrameCachedValue_8 ?? (perFrameCachedValue_8 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetTag(GAME_TAG.OVERLOAD_OWED)));

		public static int OurHeroHealthAndArmor => perFrameCachedValue_9 ?? (perFrameCachedValue_9 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetHero().GetRealTimeRemainingHP()));

		public static int OurHeroArmor => perFrameCachedValue_10 ?? (perFrameCachedValue_10 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetHero().GetArmor()));

		public static int EnemyHeroHealthAndArmor => perFrameCachedValue_11 ?? (perFrameCachedValue_11 = new PerFrameCachedValue<int>(() => GameState.GetOpposingSidePlayer().GetHero().GetRealTimeRemainingHP()));

		public static int EnemyHeroArmor => perFrameCachedValue_12 ?? (perFrameCachedValue_12 = new PerFrameCachedValue<int>(() => GameState.GetOpposingSidePlayer().GetHero().GetArmor()));

		public static int OurHeroAttack => perFrameCachedValue_13 ?? (perFrameCachedValue_13 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetHeroCard().GetRealTimeAttack()));

		public static int EnemyHeroAttack => perFrameCachedValue_14 ?? (perFrameCachedValue_14 = new PerFrameCachedValue<int>(() => GameState.GetOpposingSidePlayer().GetHeroCard().GetRealTimeAttack()));

		public static HSCard OurHeroPowerCard => perFrameCachedValue_15 ?? (perFrameCachedValue_15 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetFriendlySidePlayer().GetHeroPowerCard())));

		public static HSCard EnemyHeroPowerCard => perFrameCachedValue_16 ?? (perFrameCachedValue_16 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetOpposingSidePlayer().GetHeroPowerCard())));

		public static HSCard OurHero => perFrameCachedValue_17 ?? (perFrameCachedValue_17 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetFriendlySidePlayer().GetHeroCard())));

		public static HSCard EnemyHero => perFrameCachedValue_18 ?? (perFrameCachedValue_18 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetOpposingSidePlayer().GetHeroCard())));

		public static bool DoWeHaveWeapon => perFrameCachedValue_19 ?? (perFrameCachedValue_19 = new PerFrameCachedValue<bool>(() => GameState.GetFriendlySidePlayer().GetHero().GetWeaponCard() != null));

		public static bool DoesEnemyHasWeapon => perFrameCachedValue_20 ?? (perFrameCachedValue_20 = new PerFrameCachedValue<bool>(() => GameState.GetOpposingSidePlayer().GetHero().GetWeaponCard() != null));

		public static HSCard OurWeaponCard => perFrameCachedValue_21 ?? (perFrameCachedValue_21 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetFriendlySidePlayer().GetHero().GetWeaponCard())));

		public static HSCard EnemyWeaponCard => perFrameCachedValue_22 ?? (perFrameCachedValue_22 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetOpposingSidePlayer().GetHero().GetWeaponCard())));

		public static int EnemyPlayerFatigue => perFrameCachedValue_23 ?? (perFrameCachedValue_23 = new PerFrameCachedValue<int>(() => GameState.GetOpposingSidePlayer().GetFatigue()));

		public static int LocalPlayerFatigue => perFrameCachedValue_24 ?? (perFrameCachedValue_24 = new PerFrameCachedValue<int>(() => GameState.GetFriendlySidePlayer().GetFatigue()));

		public static HSCard CurrentPlayer => perFrameCachedValue_25 ?? (perFrameCachedValue_25 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetCurrentPlayer())));

		public static HSCard RemotePlayer => perFrameCachedValue_26 ?? (perFrameCachedValue_26 = new PerFrameCachedValue<HSCard>(() => new HSCard(GameState.GetOpposingSidePlayer())));

		public static int MyRank => perFrameCachedValue_27 ?? (perFrameCachedValue_27 = new PerFrameCachedValue<int>(delegate
		{
			RankMgr rankMgr = RankMgr.Get();
			if (rankMgr != null)
			{
				BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();
				if (myPlayer != null)
				{
					MedalInfoTranslator rankPresenceField = rankMgr.GetRankPresenceField(myPlayer);
					if (rankPresenceField != null)
					{
						TranslatedMedalInfo currMedalInfo = rankPresenceField.m_currMedalInfo;
						if (currMedalInfo != null)
						{
							return currMedalInfo.rank;
						}
					}
				}
			}
			return -1;
		}));

		public static int MyRankWild => perFrameCachedValue_28 ?? (perFrameCachedValue_28 = new PerFrameCachedValue<int>(delegate
		{
			RankMgr rankMgr = RankMgr.Get();
			if (rankMgr != null)
			{
				BnetPlayer myPlayer = BnetPresenceMgr.Get().GetMyPlayer();
				if (myPlayer != null)
				{
					MedalInfoTranslator rankPresenceField = rankMgr.GetRankPresenceField(myPlayer);
					if (rankPresenceField != null)
					{
						TranslatedMedalInfo currWildMedalInfo = rankPresenceField.m_currWildMedalInfo;
						if (currWildMedalInfo != null)
						{
							return currWildMedalInfo.rank;
						}
					}
				}
			}
			return -1;
		}));

		public static int CurrentGold
		{
			get
			{
				BnetBar bnetBar = BnetBar.Get();
				if (bnetBar != null)
				{
					CurrencyFrame currencyFrame = bnetBar.m_currencyFrame;
					if (currencyFrame != null && currencyFrame.m_state == CurrencyFrame.State.SHOWN && int.TryParse(currencyFrame.m_amount.Text, out var result))
					{
						return result;
					}
				}
				return -1;
			}
		}

		public static event EventHandler<GuiTickEventArgs> OnGuiTick
		{
			[CompilerGenerated]
			add
			{
				EventHandler<GuiTickEventArgs> eventHandler = eventHandler_0;
				EventHandler<GuiTickEventArgs> eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler<GuiTickEventArgs> value2 = (EventHandler<GuiTickEventArgs>)Delegate.Combine(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange(ref eventHandler_0, value2, eventHandler2);
				}
				while ((object)eventHandler != eventHandler2);
			}
			[CompilerGenerated]
			remove
			{
				EventHandler<GuiTickEventArgs> eventHandler = eventHandler_0;
				EventHandler<GuiTickEventArgs> eventHandler2;
				do
				{
					eventHandler2 = eventHandler;
					EventHandler<GuiTickEventArgs> value2 = (EventHandler<GuiTickEventArgs>)Delegate.Remove(eventHandler2, value);
					eventHandler = Interlocked.CompareExchange(ref eventHandler_0, value2, eventHandler2);
				}
				while ((object)eventHandler != eventHandler2);
			}
		}

		public static FrameLock AcquireFrame()
		{
			return Memory.AcquireFrame(isHardLock: true);
		}

		internal static bool smethod_0(Process process_0, Delegate6 delegate6_0, out string string_0)
		{
			//string_0 = "";
			//return true;
			if (Initialized)
			{
				string_0 = "SmartInitialize has already been called.";
				return false;
			}
			if (process_0 == null)
			{
				string_0 = "process == null";
				return false;
			}
			if (delegate6_0 == null)
			{
				string_0 = "getOffsetsDelegate == null";
				return false;
			}
			if (Class247.smethod_1(process_0.MainModule.FileName) == Class247.UInt32_0)
			{
				string_0 = "This client version is unsupported.";
				return false;
			}
			byte[] array = delegate6_0(String_0, out string_0);
			if (array != null)
			{
				if (!string.IsNullOrEmpty(string_0))
				{
					string_0 = string.Format("The data required to run the bot was not successfully obtained. Please make sure your key is still valid at the Buddy Auth Portal: http://buddyauth.com/User/Keys {0}{0}For any further assistance, please contact support: https://bosslandgmbh.zendesk.com/home", Environment.NewLine);
				}
				return false;
			}
			try
			{
				ExternalProcessMemoryInitParams externalProcessMemoryInitParams = new ExternalProcessMemoryInitParams
				{
					Process = process_0,
					StartupRasm = false,
					DefaultCacheValue = true,
					Executor = ExecutorInitParams.DX9()
				};
				externalProcessMemoryInitParams.Executor.MinSkipBytes = 8;
				try
				{
					externalProcessMemory_0 = new ExternalProcessMemory(externalProcessMemoryInitParams);
				}
				catch (Exception ex)
				{
					if (!ex.Message.Equals("Could not find DX9 in process!"))
					{
						throw;
					}
					ilog_0.Info("Process is not using DX9, now trying DX11...");
					externalProcessMemoryInitParams = new ExternalProcessMemoryInitParams
					{
						Process = process_0,
						StartupRasm = false,
						DefaultCacheValue = true,
						Executor = ExecutorInitParams.DX11()
					};
					externalProcessMemoryInitParams.Executor.MinSkipBytes = 8;
					externalProcessMemory_0 = new ExternalProcessMemory(externalProcessMemoryInitParams);
				}
				externalProcessMemory_0.ProcessExited += delegate
				{
					ilog_0.Info("[ProcessExited] The game process has closed. Hearthbuddy will now close.");
					Environment.Exit(0);
				};
				try
				{
				}
				catch (Exception)
				{
					string_0 = string.Format("The data required to run the bot is corrupted. Please make sure your key is still valid at the Buddy Auth Portal: http://buddyauth.com/User/Keys {0}{0}For any further assistance, please contact support: https://bosslandgmbh.zendesk.com/home", Environment.NewLine);
					return false;
				}
				class276_0 = new Class276(externalProcessMemory_0);
				using (AcquireFrame())
				{
					intptr_1 = Class276_0.method_2();
				}
				ProcessHookManager.smethod_3();
				Hotkeys.Initialize(ClientWindowHandle);
				Input.DebugMouseCursorPos = false;
				Initialized = true;
				bool_0 = false;
			}
			catch (Exception ex3)
			{
				string_0 = ex3.ToString();
				return false;
			}
			string_0 = string.Empty;
			return true;
		}

		internal static void smethod_1()
		{
			ProcessHookManager.smethod_4();
			if (intptr_1 != IntPtr.Zero)
			{
				Class276_0.method_3(intptr_1);
				intptr_1 = IntPtr.Zero;
			}
			if (Memory == null)
			{
				return;
			}
			if (Memory.Executor != null)
			{
				try
				{
					Memory.Executor.Dispose();
				}
				catch
				{
				}
			}
			try
			{
				Memory.Dispose();
			}
			catch
			{
			}
			externalProcessMemory_0 = null;
		}

		public static void InvokeEvent(Delegate d, params object[] args)
		{
			if ((object)d == null)
			{
				return;
			}
			Delegate[] invocationList = d.GetInvocationList();
			foreach (Delegate @delegate in invocationList)
			{
				try
				{
					@delegate.DynamicInvoke(args);
				}
				catch (Exception arg)
				{
					ilog_0.ErrorFormat("[InvokeEvent] Exception during handler: {0}", arg);
				}
			}
		}

		public static void GuiTick(Window window)
		{
			using (new PerformanceTimer("OnGuiTick"))
			{
				InvokeEvent(eventHandler_0, null, new GuiTickEventArgs(window));
			}
		}

		internal static void smethod_2(bool bool_3 = true)
		{
			try
			{
				if (bool_3)
				{
					using (AcquireFrame())
					{
						MonoClass.smethod_0();
					}
				}
				else
				{
					MonoClass.smethod_0();
				}
			}
			catch (Exception exception)
			{
				ilog_0.Error("[CollectGarbage] Exception during execution:", exception);
			}
		}

		private static string smethod_3(string string_0)
		{
			StringBuilder stringBuilder = new StringBuilder(string_0);
			for (int i = 3; i < string_0.Length; i++)
			{
				stringBuilder[i] = '*';
			}
			return stringBuilder.ToString();
		}

		internal static void smethod_4(PresenceMgr presenceMgr_0, ref PresenceStatus presenceStatus_0)
		{
			if (presenceStatus_0 != PresenceStatus.WELCOMEQUESTS)
			{
				return;
			}
			List<MonoEnum> prevStatus = presenceMgr_0.GetPrevStatus();
			if (prevStatus != null)
			{
				MonoEnum monoEnum = prevStatus.FirstOrDefault();
				if (monoEnum != null)
				{
					presenceStatus_0 = monoEnum.AsEnum<PresenceStatus>();
					ilog_0.InfoFormat("[FixWelcomeQuestPresenceStatus] The current PresenceStatus is {0}. Now using the previous PresenceStatus: {1}.", PresenceStatus.WELCOMEQUESTS, presenceStatus_0);
				}
				else
				{
					ilog_0.InfoFormat("[FixWelcomeQuestPresenceStatus] The current PresenceStatus is {0}. There is no previous PresenceStatus set.", PresenceStatus.WELCOMEQUESTS);
				}
			}
		}

		public static bool HandleDialog(ShouldAcceptFriendlyChallengeDelegate shouldAcceptFriendlyChallenge, out bool unhandled)
		{
			unhandled = false;
			DialogManager dialogManager = DialogManager.Get();
			if (dialogManager == null)
			{
				return false;
			}
			if (!dialogManager.ShowingDialog())
			{
				return false;
			}
			DialogBase currentDialog = dialogManager.m_currentDialog;
			if (currentDialog == null)
			{
				return true;
			}
			string realClassName = currentDialog.RealClassName;
			ilog_0.InfoFormat("[HandleDialogs] A dialog of type {0} is showing.", realClassName);
			switch (realClassName)
			{
			case "AlertPopup":
			{
				AlertPopup alertPopup = new AlertPopup(currentDialog.Address);
				ilog_0.InfoFormat("[HandleDialogs] {0}.", alertPopup.m_alertText.Text);
				PresenceMgr presenceMgr = PresenceMgr.Get();
				if (presenceMgr != null)
				{
					List<MonoEnum> statusEnums = presenceMgr.GetStatusEnums(BnetPresenceMgr.Get().GetMyPlayer());
					if (statusEnums != null && statusEnums.Any())
					{
						foreach (MonoEnum item in statusEnums)
						{
							PresenceStatus presenceStatus_ = item.AsEnum<PresenceStatus>();
							smethod_4(presenceMgr, ref presenceStatus_);
							if (presenceStatus_ == PresenceStatus.FRIENDLY_DECKPICKER)
							{
								return true;
							}
						}
					}
				}
				UIBButton okayButton2 = alertPopup.m_okayButton;
				if (okayButton2 == null)
				{
					unhandled = true;
					return true;
				}
				ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"OK\" button.");
				okayButton2.TriggerPress();
				okayButton2.TriggerRelease();
				return true;
			}
			case "BasicPopup":
			{
				BasicPopup basicPopup = new BasicPopup(currentDialog.Address);
				if (basicPopup.m_headerText != null && basicPopup.m_headerText.Text != null)
				{
					ilog_0.InfoFormat("[HandleDialogs] {0}.", basicPopup.m_headerText.Text);
				}
				if (basicPopup.m_bodyText != null && basicPopup.m_bodyText.Text != null)
				{
					ilog_0.InfoFormat("[HandleDialogs] {0}.", basicPopup.m_bodyText.Text);
				}
				if (basicPopup.m_customButton == null)
				{
					UIBButton cancelButton = basicPopup.m_cancelButton;
					if (cancelButton != null && cancelButton.IsEnabled())
					{
						ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"{0}\" button.", cancelButton.m_ButtonText);
						cancelButton.TriggerPress();
						cancelButton.TriggerRelease();
						return true;
					}
				}
				unhandled = true;
				return true;
			}
			case "SeasonEndDialog":
			{
				SeasonEndDialog seasonEndDialog = new SeasonEndDialog(currentDialog.Address);
				ilog_0.InfoFormat("[HandleDialogs] {0}.", seasonEndDialog.m_header.Text);
				UIBButton okayButton3 = seasonEndDialog.m_okayButton;
				if (okayButton3 == null)
				{
					unhandled = true;
					return true;
				}
				ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"OK\" button.");
				okayButton3.TriggerPress();
				okayButton3.TriggerRelease();
				return true;
			}
			case "FriendlyChallengeDialog":
			{
				FriendlyChallengeDialog friendlyChallengeDialog = new FriendlyChallengeDialog(currentDialog.Address);
				string text = friendlyChallengeDialog.m_challengerName.Text;
				ilog_0.InfoFormat("[HandleDialogs] The player \"{0}\" is challenging us.", smethod_3(text));
				UIBButton denyButton = friendlyChallengeDialog.m_denyButton;
				UIBButton acceptButton = friendlyChallengeDialog.m_acceptButton;
				if (denyButton != null && acceptButton != null)
				{
					if (shouldAcceptFriendlyChallenge != null && shouldAcceptFriendlyChallenge(text))
					{
						ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"Accept\" button.");
						acceptButton.TriggerPress();
						acceptButton.TriggerRelease();
					}
					else
					{
						ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"Deny\" button.");
						denyButton.TriggerPress();
						denyButton.TriggerRelease();
					}
					return true;
				}
				unhandled = true;
				return true;
			}
			case "OutstandingDraftTicketDialog":
			{
				UIBButton okayButton = new OutstandingDraftTicketDialog(currentDialog.Address).m_okayButton;
				if (okayButton == null)
				{
					unhandled = true;
					return true;
				}
				ilog_0.InfoFormat("[HandleDialogs] Now clicking on the \"OK\" button.");
				okayButton.TriggerPress();
				okayButton.TriggerRelease();
				return true;
			}
			default:
				unhandled = true;
				return true;
			}
		}

		public static bool IsClientInUsableState(bool logReason = false)
		{
			LoadingScreen loadingScreen = LoadingScreen.Get();
			if (loadingScreen != null && loadingScreen.IsTransitioning())
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] LoadingScreen.IsTransitioning.");
				}
				return false;
			}
			SceneMgr sceneMgr = SceneMgr.Get();
			if (sceneMgr == null)
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] SceneMgr is null.");
				}
				return false;
			}
			if (!sceneMgr.IsSceneLoaded())
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] !SceneMgr.IsSceneLoaded.");
				}
				return false;
			}
			if (sceneMgr.IsTransitioning())
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] SceneMgr.IsTransitioning.");
				}
				return false;
			}
			if (sceneMgr.GetNextMode() != 0)
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] SceneMgr.GetNextMode != Mode.INVALID.");
				}
				return false;
			}
			Box box = Box.Get();
			if (box != null && box.IsBusy())
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] Box.IsBusy.");
				}
				return false;
			}
			GameState gameState = GameState.Get();
			if (gameState != null)
			{
				if (gameState.IsBusy())
				{
					if (logReason)
					{
						ilog_0.InfoFormat("[IsClientInUsableState] GameState.IsBusy.");
					}
					return false;
				}
				PowerProcessor powerProcessor = gameState.GetPowerProcessor();
				if (powerProcessor != null && powerProcessor.HasTaskLists() && !GameState.Get().IsGameOver())
				{
					return false;
				}
			}
			ReconnectMgr reconnectMgr = ReconnectMgr.Get();
			if (reconnectMgr != null && (reconnectMgr.IsReconnecting() || reconnectMgr.IsStartingReconnectGame()))
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[IsClientInUsableState] Waiting for ReconnectMgr to reconnect.");
				}
				return false;
			}
			return true;
		}

		public static bool ClickTavernBrawlButton(bool logReason)
		{
			return ClickHubButton(Enum19.TavernBrawl, logReason);
		}

		public static bool ClickPlayButton(bool logReason)
		{
			return ClickHubButton(Enum19.Play, logReason);
		}

		public static bool ClickQuestButton(bool logReason)
		{
			return ClickHubButton(Enum19.Quest, logReason);
		}

		public static bool ClickStoreButton(bool logReason)
		{
			return ClickHubButton(Enum19.Store, logReason);
		}

		public static bool ClickCollectionButton(bool logReason)
		{
			return ClickHubButton(Enum19.Collection, logReason);
		}

		public static bool ClickPacksButton(bool logReason)
		{
			return ClickHubButton(Enum19.Packs, logReason);
		}

		public static bool ClickAdventureButton(bool logReason)
		{
			return ClickHubButton(Enum19.Adventure, logReason);
		}

		public static bool ClickArenaButton(bool logReason)
		{
			return ClickHubButton(Enum19.Arena, logReason);
		}

		private static bool ClickHubButton(Enum19 enum19_0, bool bool_3)
		{
			try
			{
				if (!IsClientInUsableState(bool_3))
				{
					return false;
				}
				if (SceneMgr.Get().GetMode() != SceneMgr.Mode.HUB)
				{
					if (bool_3)
					{
						ilog_0.InfoFormat("[ClickHubButton] SceneMgr.GetMode != SceneMgr.Mode.HUB.");
					}
					return false;
				}
				Box box = Box.Get();
				if (box.GetCamera() == null)
				{
					if (bool_3)
					{
						ilog_0.InfoFormat("[ClickHubButton] Box.GetCamera is null.");
					}
					return false;
				}
				if (enum19_0 == Enum19.TavernBrawl && box.IsTavernBrawlButtonDeactivated)
				{
					if (bool_3)
					{
						ilog_0.InfoFormat("[ClickHubButton] The TavernBrawl button is disabled.");
					}
					return false;
				}
				PegUIElement pegUIElement = null;
				switch (enum19_0)
				{
				case Enum19.Quest:
					pegUIElement = box.m_QuestLogButton;
					break;
				case Enum19.Play:
					pegUIElement = box.m_PlayButton;
					break;
				case Enum19.Store:
					pegUIElement = box.m_StoreButton;
					break;
				case Enum19.Collection:
					pegUIElement = box.m_CollectionButton;
					break;
				case Enum19.Packs:
					pegUIElement = box.m_OpenPacksButton;
					break;
				case Enum19.Adventure:
					pegUIElement = box.m_SoloAdventuresButton;
					break;
				case Enum19.Arena:
					pegUIElement = box.m_ForgeButton;
					break;
				case Enum19.TavernBrawl:
					pegUIElement = box.m_TavernBrawlButton;
					break;
				}
				if (pegUIElement == null)
				{
					if (bool_3)
					{
						ilog_0.InfoFormat("[ClickHubButton] The button object to click is null.");
					}
					return false;
				}
				Transform transform = pegUIElement.Transform;
				if (transform == null)
				{
					if (bool_3)
					{
						ilog_0.InfoFormat("[ClickHubButton] The button's transform is null.");
					}
					return false;
				}
				ilog_0.InfoFormat("[ClickHubButton] Client.MouseOver {0} .", transform.Position);//bald
				Client.MouseOver(transform.Position);
				if (enum19_0 != Enum19.Quest && enum19_0 != Enum19.Store)
				{
					BoxMenuButton boxMenuButton = null;
					switch (enum19_0)
					{
					case Enum19.Collection:
						boxMenuButton = box.m_CollectionButton;
						break;
					case Enum19.Packs:
						boxMenuButton = box.m_OpenPacksButton;
						break;
					case Enum19.Adventure:
						boxMenuButton = box.m_SoloAdventuresButton;
						break;
					case Enum19.Arena:
						boxMenuButton = box.m_ForgeButton;
						break;
					}
					if (enum19_0 == Enum19.Play)
					{
						boxMenuButton = box.m_PlayButton;
					}
					if (enum19_0 == Enum19.TavernBrawl)
					{
						boxMenuButton = box.m_TavernBrawlButton;
					}
					if (boxMenuButton == null)
					{
						if (bool_3)
						{
							ilog_0.InfoFormat("[ClickHubButton] The button's highlight state was unable to be obtained.");
						}
						return false;
					}
					Spell spell = boxMenuButton.m_Spell;
					if (spell == null)
					{
						if (bool_3)
						{
							ilog_0.InfoFormat("[ClickHubButton] The button's highlight state (spell) is null.");
						}
						return false;
					}
					if (spell.m_activeStateType != SpellStateType.BIRTH)
					{
						if (bool_3)
						{
							ilog_0.InfoFormat("[ClickHubButton] The button is not highlighted.");
						}
						return false;
					}
				}
				else
				{
					HighlightState highlightState = null;
					switch (enum19_0)
					{
					case Enum19.Quest:
						highlightState = box.m_QuestLogButton.m_highlight;
						break;
					case Enum19.Store:
						highlightState = box.m_StoreButton.m_highlightState;
						break;
					}
					if (highlightState == null)
					{
						if (bool_3)
						{
							ilog_0.InfoFormat("[ClickHubButton] The button's highlight state was unable to be obtained.");
						}
						return false;
					}
					if (highlightState.m_CurrentState != ActorStateType.HIGHLIGHT_MOUSE_OVER)
					{
						if (bool_3)
						{
							ilog_0.InfoFormat("[ClickHubButton] The button is not highlighted.");
						}
						return false;
					}
				}
				Client.ClickLMB();
				return true;
			}
			catch (Exception ex)
			{
				if (bool_3)
				{
					ilog_0.InfoFormat("[ClickHubButton] An exception occurred. {0}", ex.ToString());
				}
				return false;
			}
		}

		public static bool Concede(bool logReason)
		{
			try
			{
				if (GameState.Get() == null)
				{
					if (logReason)
					{
						ilog_0.InfoFormat("[Concede] GameState == null.");
					}
					return false;
				}
				if (!GameUtils.CanConcedeCurrentMission())
				{
					ilog_0.InfoFormat("[Concede] !GameUtils.CanConcedeCurrentMission().");
					return false;
				}
				GameState.Get().Concede();
				using (Memory.ReleaseFrame(reacquireAsHardLock: true))
				{
					Thread.Sleep(1000);
				}
				return true;
			}
			catch (Exception ex)
			{
				if (logReason)
				{
					ilog_0.InfoFormat("[Concede] An exception occurred. {0}", ex.ToString());
				}
				return false;
			}
		}

		public static bool IsInChoiceMode()
		{
			ChoiceCardMgr choiceCardMgr = ChoiceCardMgr.Get();
			if (choiceCardMgr == null)
			{
				return false;
			}
			return choiceCardMgr.GetFriendlyCards()?.Any() ?? false;
		}

		public static void ChooseOneClickLeft()
		{
			Client.LeftClickAt(Client.CardInteractPoint(ChoiceCardMgr.Get().GetFriendlyCards()[0]));
		}

		public static void ChooseOneClickMiddle()
		{
			List<Card> friendlyCards = ChoiceCardMgr.Get().GetFriendlyCards();
			if (friendlyCards.Count == 1)
			{
				ChooseOneClickLeft();
			}
			else if (friendlyCards.Count == 2)
			{
				ChooseOneClickRight();
			}
			else if (friendlyCards.Count == 3)
			{
				Client.LeftClickAt(Client.CardInteractPoint(friendlyCards[1]));
			}
			else if (friendlyCards.Count == 4)
			{
				Client.LeftClickAt(Client.CardInteractPoint(friendlyCards[2]));
			}
			else if (friendlyCards.Count == 5)
			{
				Client.LeftClickAt(Client.CardInteractPoint(friendlyCards[3]));
			}
		}

		public static void ChooseOneClickRight()
		{
			List<Card> friendlyCards = ChoiceCardMgr.Get().GetFriendlyCards();
			Client.LeftClickAt(Client.CardInteractPoint(friendlyCards[friendlyCards.Count - 1]));
		}

		public static List<HSCard> GetCards(CardZone zone, bool localPlayer = true)
		{
			Player player = ((!localPlayer) ? GameState.GetOpposingSidePlayer() : GameState.GetFriendlySidePlayer());
			return zone switch
			{
				CardZone.Hand => (from card_0 in player.GetHandZone().GetCards()
					select new HSCard(card_0)).ToList(), 
				CardZone.Battlefield => (from card_0 in player.GetBattlefieldZone().GetCards()
					select new HSCard(card_0)).ToList(), 
				CardZone.Graveyard => (from card_0 in player.GetGraveyardZone().GetCards()
					select new HSCard(card_0)).ToList(), 
				_ => throw new ArgumentOutOfRangeException("zone"), 
			};
		}

		public static List<HSCard> GetAllCards()
		{
			return perFrameCachedValue_1 ?? (perFrameCachedValue_1 = new PerFrameCachedValue<List<HSCard>>(delegate
			{
				List<HSCard> list = new List<HSCard>();
				Entity entity = null;
				int num = 4;
				do
				{
					entity = GameState.GetEntity(num);
					num++;
					if (entity != null)
					{
						list.Add(new HSCard(entity));
					}
				}
				while (entity != null);
				return list;
			}));
		}

		public static async Task DoTarget(HSCard target)
		{
			Vector3 center = Client.CardInteractPoint(target.Card);
			await Client.MoveCursorHumanLike(center);
			Client.LeftClickAt(center);
		}

		public static async Task EndTurn()
		{
			Vector3 position = EndTurnButton.Get().Transform.Position;
			await Client.MoveCursorHumanLike(position);
			Client.LeftClickAt(position);
		}

		public static bool IsInTargetMode()
		{
			return GameState.IsInTargetMode();
		}

		public static void CancelTargetingMode()
		{
			Client.ClickRMB();
		}

		public static bool IsQuestForClass(int questId, TAG_CLASS @class)
		{
			switch (@class)
			{
			case TAG_CLASS.DRUID:
				if (questId != 32 && questId != 33 && questId != 41 && questId != 42 && questId != 223 && questId != 589 && questId != 598)
				{
					return questId == 644;
				}
				return true;
			case TAG_CLASS.HUNTER:
				if (questId != 32 && questId != 34 && questId != 41 && questId != 43 && questId != 224 && questId != 590 && questId != 599)
				{
					return questId == 640;
				}
				return true;
			case TAG_CLASS.MAGE:
				if (questId != 34 && questId != 35 && questId != 43 && questId != 44 && questId != 225 && questId != 591 && questId != 600)
				{
					return questId == 646;
				}
				return true;
			case TAG_CLASS.PALADIN:
				if (questId != 36 && questId != 37 && questId != 45 && questId != 46 && questId != 226 && questId != 592 && questId != 601)
				{
					return questId == 640;
				}
				return true;
			case TAG_CLASS.PRIEST:
				if (questId != 36 && questId != 38 && questId != 45 && questId != 47 && questId != 227 && questId != 593 && questId != 602)
				{
					return questId == 646;
				}
				return true;
			case TAG_CLASS.ROGUE:
				if (questId != 33 && questId != 39 && questId != 42 && questId != 48 && questId != 228 && questId != 594 && questId != 603)
				{
					return questId == 644;
				}
				return true;
			case TAG_CLASS.SHAMAN:
				if (questId != 35 && questId != 40 && questId != 44 && questId != 49 && questId != 229 && questId != 595 && questId != 604)
				{
					return questId == 644;
				}
				return true;
			case TAG_CLASS.WARLOCK:
				if (questId != 38 && questId != 40 && questId != 47 && questId != 49 && questId != 230 && questId != 596 && questId != 605)
				{
					return questId == 646;
				}
				return true;
			case TAG_CLASS.WARRIOR:
				if (questId != 37 && questId != 39 && questId != 46 && questId != 48 && questId != 231 && questId != 597 && questId != 606)
				{
					return questId == 640;
				}
				return true;
			default:
				return false;
			}
		}

		public static bool IsQuestForSpecificClass(int questId)
		{
			if ((questId < 32 || questId > 49) && (questId < 223 || questId > 231) && (questId < 589 || questId > 597) && (questId < 598 || questId > 606) && questId != 640 && questId != 644)
			{
				return questId == 646;
			}
			return true;
		}

		public static string GetBasicHeroCardIdFromClass(TAG_CLASS classTag)
		{
			return classTag switch
			{
				TAG_CLASS.DRUID => "HERO_06", 
				TAG_CLASS.HUNTER => "HERO_05", 
				TAG_CLASS.MAGE => "HERO_08", 
				TAG_CLASS.PALADIN => "HERO_04", 
				TAG_CLASS.PRIEST => "HERO_09", 
				TAG_CLASS.ROGUE => "HERO_03", 
				TAG_CLASS.SHAMAN => "HERO_02", 
				TAG_CLASS.WARLOCK => "HERO_07", 
				TAG_CLASS.WARRIOR => "HERO_01", 
				_ => throw new Exception($"[GetBasicHeroCardIdFromClass] Unhandled class {classTag}."), 
			};
		}

		public static TAG_CLASS GetBasicHeroClassFromCardId(string cardId)
		{
			uint num = Class280.smethod_0(cardId);
			if (num <= 2143518344)
			{
				if (num <= 1789761322)
				{
					if (num <= 1588032536)
					{
						if (num != 1386406918)
						{
							if (num == 1588032536 && cardId == "HERO_05a")
							{
								goto IL_0176;
							}
						}
						else if (cardId == "HERO_07a")
						{
							goto IL_012c;
						}
					}
					else if (num != 1724224964)
					{
						if (num == 1789761322 && cardId == "HERO_03a")
						{
							goto IL_01fd;
						}
					}
					else if (cardId == "HERO_09a")
					{
						goto IL_0226;
					}
				}
				else if (num <= 2007325916)
				{
					if (num != 1991386940)
					{
						if (num == 2007325916 && cardId == "HERO_04b")
						{
							goto IL_0188;
						}
					}
					else if (cardId == "HERO_01a")
					{
						goto IL_01ed;
					}
				}
				else if (num != 2111415856)
				{
					if (num != 2128193475)
					{
						if (num == 2143518344 && cardId == "HERO_08b")
						{
							goto IL_0235;
						}
					}
					else if (cardId == "HERO_07")
					{
						goto IL_012c;
					}
				}
				else if (cardId == "HERO_06")
				{
					return TAG_CLASS.DRUID;
				}
			}
			else if (num <= 2193851201u)
			{
				if (num <= 2161748713u)
				{
					if (num != 2144971094)
					{
						if (num == 2161748713u && cardId == "HERO_05")
						{
							goto IL_0176;
						}
					}
					else if (cardId == "HERO_04")
					{
						goto IL_0188;
					}
				}
				else if (num != 2178526332u)
				{
					if (num == 2193851201u && cardId == "HERO_08a")
					{
						goto IL_0235;
					}
				}
				else if (cardId == "HERO_02")
				{
					goto IL_0255;
				}
			}
			else if (num <= 2228859189u)
			{
				if (num != 2195303951u)
				{
					if (num == 2228859189u && cardId == "HERO_01")
					{
						goto IL_01ed;
					}
				}
				else if (cardId == "HERO_03")
				{
					goto IL_01fd;
				}
			}
			else if (num != 2259284391u)
			{
				if (num != 2346302522u)
				{
					if (num == 2363080141u && cardId == "HERO_09")
					{
						goto IL_0226;
					}
				}
				else if (cardId == "HERO_08")
				{
					goto IL_0235;
				}
			}
			else if (cardId == "HERO_02a")
			{
				goto IL_0255;
			}
			throw new Exception($"[GetBasicHeroClassFromCardId] Unhandled card id {cardId}.");
			IL_0235:
			return TAG_CLASS.MAGE;
			IL_0226:
			return TAG_CLASS.PRIEST;
			IL_0255:
			return TAG_CLASS.SHAMAN;
			IL_01fd:
			return TAG_CLASS.ROGUE;
			IL_0176:
			return TAG_CLASS.HUNTER;
			IL_012c:
			return TAG_CLASS.WARLOCK;
			IL_01ed:
			return TAG_CLASS.WARRIOR;
			IL_0188:
			return TAG_CLASS.PALADIN;
		}

		static TritonHs()
		{
			ilog_0 = Triton.Common.LogUtilities.Logger.GetLoggerInstanceForType();
			bool_0 = true;
			stopwatch_0 = Stopwatch.StartNew();
			BasicMageDeck = new List<string>
			{
				"EX1_277", "EX1_277", "CS2_168", "CS2_168", "CS2_025", "CS2_025", "CS2_172", "CS2_172", "EX1_015", "EX1_015",
				"CS2_120", "CS2_120", "CS2_023", "CS2_023", "CS2_122", "CS2_122", "CS2_124", "CS2_124", "CS2_029", "CS2_029",
				"CS2_022", "CS2_022", "CS2_119", "CS2_119", "CS2_179", "CS2_179", "EX1_593", "EX1_593", "CS2_200", "CS2_200"
			};
			BasicDruidDeck = new List<string>
			{
				"EX1_169", "EX1_169", "CS2_005", "CS2_005", "CS2_189", "CS2_189", "CS2_009", "CS2_009", "CS2_013", "CS2_013",
				"CS2_120", "CS2_120", "CS2_007", "CS2_007", "CS2_127", "CS2_127", "CS2_182", "CS2_182", "CS2_119", "CS2_119",
				"DS1_055", "DS1_055", "EX1_593", "EX1_593", "CS2_200", "CS2_200", "CS2_162", "CS2_162", "CS2_201", "CS2_201"
			};
			BasicHunterDeck = new List<string>
			{
				"DS1_185", "DS1_185", "DS1_184", "DS1_184", "CS2_171", "CS2_171", "DS1_175", "DS1_175", "CS2_172", "CS2_172",
				"CS2_120", "CS2_120", "CS2_141", "CS2_141", "CS2_122", "CS2_122", "CS2_196", "CS2_196", "CS2_127", "CS2_127",
				"DS1_183", "DS1_183", "DS1_070", "DS1_070", "CS2_119", "CS2_119", "CS2_150", "CS2_150", "CS2_201", "CS2_201"
			};
			BasicPaladinDeck = new List<string>
			{
				"CS2_091", "CS2_091", "CS2_087", "CS2_087", "EX1_371", "EX1_371", "CS1_042", "CS1_042", "CS2_171", "CS2_171",
				"CS2_089", "CS2_089", "CS2_141", "CS2_141", "CS2_122", "CS2_122", "CS2_094", "CS2_094", "CS2_147", "CS2_147",
				"CS2_131", "CS2_131", "EX1_593", "EX1_593", "CS2_150", "CS2_150", "CS2_162", "CS2_162", "CS2_222", "CS2_222"
			};
			BasicPriestDeck = new List<string>
			{
				"CS1_130", "CS1_130", "CS2_004", "CS2_004", "CS2_189", "CS2_189", "CS2_235", "CS2_235", "EX1_011", "EX1_011",
				"DS1_233", "DS1_233", "CS2_234", "CS2_234", "CS2_172", "CS2_172", "CS2_121", "CS2_121", "EX1_019", "EX1_019",
				"CS2_127", "CS2_127", "CS2_182", "CS2_182", "CS2_179", "CS2_179", "EX1_399", "EX1_399", "CS2_201", "CS2_201"
			};
			BasicRogueDeck = new List<string>
			{
				"CS2_072", "CS2_072", "CS2_074", "CS2_074", "CS2_075", "CS2_075", "CS2_189", "CS2_189", "CS1_042", "CS1_042",
				"EX1_581", "EX1_581", "CS2_172", "CS2_172", "EX1_015", "EX1_015", "CS2_141", "CS2_141", "EX1_025", "EX1_025",
				"CS2_147", "CS2_147", "CS2_131", "CS2_131", "CS2_076", "CS2_076", "EX1_593", "EX1_593", "CS2_150", "CS2_150"
			};
			BasicShamanDeck = new List<string>
			{
				"CS2_041", "CS2_041", "CS2_037", "CS2_037", "CS2_045", "CS2_045", "CS2_171", "CS2_171", "EX1_011", "EX1_011",
				"CS2_039", "CS2_039", "CS2_121", "CS2_121", "EX1_246", "EX1_246", "CS2_122", "CS2_122", "CS2_124", "CS2_124",
				"CS2_182", "CS2_182", "CS2_179", "CS2_179", "CS2_187", "CS2_187", "CS2_226", "CS2_226", "CS2_213", "CS2_213"
			};
			BasicWarlockDeck = new List<string>
			{
				"CS2_168", "CS2_168", "CS2_065", "CS2_065", "EX1_011", "EX1_011", "CS2_142", "CS2_142", "CS2_120", "CS2_120",
				"EX1_306", "EX1_306", "CS2_061", "CS2_061", "CS2_057", "CS2_057", "CS2_124", "CS2_124", "CS2_062", "CS2_062",
				"CS2_182", "CS2_182", "CS2_197", "CS2_197", "DS1_055", "DS1_055", "CS2_213", "CS2_213", "CS2_186", "CS2_186"
			};
			BasicWarriorDeck = new List<string>
			{
				"CS2_108", "CS2_108", "CS2_168", "CS2_168", "CS2_106", "CS2_106", "CS2_105", "CS2_105", "CS2_121", "CS2_121",
				"EX1_506", "EX1_506", "CS2_103", "CS2_103", "CS2_196", "CS2_196", "EX1_084", "EX1_084", "CS2_124", "CS2_124",
				"EX1_025", "EX1_025", "CS2_179", "CS2_179", "EX1_399", "EX1_399", "CS2_200", "CS2_200", "CS2_162", "CS2_162"
			};
			BasicHeroTagClasses = new TAG_CLASS[9]
			{
				TAG_CLASS.DRUID,
				TAG_CLASS.HUNTER,
				TAG_CLASS.MAGE,
				TAG_CLASS.PALADIN,
				TAG_CLASS.PRIEST,
				TAG_CLASS.ROGUE,
				TAG_CLASS.SHAMAN,
				TAG_CLASS.WARLOCK,
				TAG_CLASS.WARRIOR
			};
		}
	}
}
